// $ANTLR 3.1.3 Mar 17, 2009 19:23:44 CalculatorLexer.g 2010-01-30 20:46:28

  package org.concepts.java.antlr.calculator;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

public class CalculatorLexer extends Lexer {
    public static final int RPAREN=10;
    public static final int WHITESPACE=11;
    public static final int PLS=5;
    public static final int INT=4;
    public static final int MIN=6;
    public static final int DIV=8;
    public static final int EOF=-1;
    public static final int MUL=7;
    public static final int LPAREN=9;

    // delegates
    // delegators

    public CalculatorLexer() {;} 
    public CalculatorLexer(CharStream input) {
        this(input, new RecognizerSharedState());
    }
    public CalculatorLexer(CharStream input, RecognizerSharedState state) {
        super(input,state);

    }
    public String getGrammarFileName() { return "CalculatorLexer.g"; }

    // $ANTLR start "INT"
    public final void mINT() throws RecognitionException {
        try {
            int _type = INT;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // CalculatorLexer.g:13:13: ( ( '0' .. '9' )+ )
            // CalculatorLexer.g:13:15: ( '0' .. '9' )+
            {
            // CalculatorLexer.g:13:15: ( '0' .. '9' )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( ((LA1_0>='0' && LA1_0<='9')) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // CalculatorLexer.g:13:15: '0' .. '9'
            	    {
            	    matchRange('0','9'); 

            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "INT"

    // $ANTLR start "PLS"
    public final void mPLS() throws RecognitionException {
        try {
            int _type = PLS;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // CalculatorLexer.g:15:13: ( '+' )
            // CalculatorLexer.g:15:16: '+'
            {
            match('+'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "PLS"

    // $ANTLR start "MIN"
    public final void mMIN() throws RecognitionException {
        try {
            int _type = MIN;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // CalculatorLexer.g:17:13: ( '-' )
            // CalculatorLexer.g:17:16: '-'
            {
            match('-'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "MIN"

    // $ANTLR start "MUL"
    public final void mMUL() throws RecognitionException {
        try {
            int _type = MUL;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // CalculatorLexer.g:19:13: ( '*' )
            // CalculatorLexer.g:19:16: '*'
            {
            match('*'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "MUL"

    // $ANTLR start "DIV"
    public final void mDIV() throws RecognitionException {
        try {
            int _type = DIV;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // CalculatorLexer.g:21:13: ( '/' )
            // CalculatorLexer.g:21:16: '/'
            {
            match('/'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "DIV"

    // $ANTLR start "LPAREN"
    public final void mLPAREN() throws RecognitionException {
        try {
            int _type = LPAREN;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // CalculatorLexer.g:23:13: ( '(' )
            // CalculatorLexer.g:23:16: '('
            {
            match('('); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "LPAREN"

    // $ANTLR start "RPAREN"
    public final void mRPAREN() throws RecognitionException {
        try {
            int _type = RPAREN;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // CalculatorLexer.g:25:13: ( ')' )
            // CalculatorLexer.g:25:16: ')'
            {
            match(')'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "RPAREN"

    // $ANTLR start "WHITESPACE"
    public final void mWHITESPACE() throws RecognitionException {
        try {
            int _type = WHITESPACE;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // CalculatorLexer.g:27:13: ( ( ' ' | '\\t' )+ )
            // CalculatorLexer.g:27:15: ( ' ' | '\\t' )+
            {
            // CalculatorLexer.g:27:15: ( ' ' | '\\t' )+
            int cnt2=0;
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( (LA2_0=='\t'||LA2_0==' ') ) {
                    alt2=1;
                }


                switch (alt2) {
            	case 1 :
            	    // CalculatorLexer.g:
            	    {
            	    if ( input.LA(1)=='\t'||input.LA(1)==' ' ) {
            	        input.consume();

            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;}


            	    }
            	    break;

            	default :
            	    if ( cnt2 >= 1 ) break loop2;
                        EarlyExitException eee =
                            new EarlyExitException(2, input);
                        throw eee;
                }
                cnt2++;
            } while (true);

            skip();

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "WHITESPACE"

    public void mTokens() throws RecognitionException {
        // CalculatorLexer.g:1:8: ( INT | PLS | MIN | MUL | DIV | LPAREN | RPAREN | WHITESPACE )
        int alt3=8;
        switch ( input.LA(1) ) {
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
        case '8':
        case '9':
            {
            alt3=1;
            }
            break;
        case '+':
            {
            alt3=2;
            }
            break;
        case '-':
            {
            alt3=3;
            }
            break;
        case '*':
            {
            alt3=4;
            }
            break;
        case '/':
            {
            alt3=5;
            }
            break;
        case '(':
            {
            alt3=6;
            }
            break;
        case ')':
            {
            alt3=7;
            }
            break;
        case '\t':
        case ' ':
            {
            alt3=8;
            }
            break;
        default:
            NoViableAltException nvae =
                new NoViableAltException("", 3, 0, input);

            throw nvae;
        }

        switch (alt3) {
            case 1 :
                // CalculatorLexer.g:1:10: INT
                {
                mINT(); 

                }
                break;
            case 2 :
                // CalculatorLexer.g:1:14: PLS
                {
                mPLS(); 

                }
                break;
            case 3 :
                // CalculatorLexer.g:1:18: MIN
                {
                mMIN(); 

                }
                break;
            case 4 :
                // CalculatorLexer.g:1:22: MUL
                {
                mMUL(); 

                }
                break;
            case 5 :
                // CalculatorLexer.g:1:26: DIV
                {
                mDIV(); 

                }
                break;
            case 6 :
                // CalculatorLexer.g:1:30: LPAREN
                {
                mLPAREN(); 

                }
                break;
            case 7 :
                // CalculatorLexer.g:1:37: RPAREN
                {
                mRPAREN(); 

                }
                break;
            case 8 :
                // CalculatorLexer.g:1:44: WHITESPACE
                {
                mWHITESPACE(); 

                }
                break;

        }

    }


 

}